{% extends "documents/manage/base.html" %}
{% load i18n %}

{% block block_title %} Document list {% endblock %}

{% block more_styles %}
    <style type="text/css" media="all">@import url("/static/css/chosen.css");</style>
    <style type="text/css" media="all">@import url("/static/css/document-mixin.css");</style>
    <style type="text/css" media="all">@import url("/static/css/south-street/jquery-ui-1.8.16.custom.css");</style>
{% endblock %}

{% block breadcrumb %} {{ block.super }} &raquo; {% trans 'Create document' %} {% endblock %}

{% block system_messages %}
    <p>
    {% for msg in system_messages %}
    <div class="message {{ msg.type }}"><p>{{ msg.message }}</p></div>
    {% endfor %}
    {% if form.errors %}
        {% for error in form.errors %}
        <div class="message errormsg"><p>{% trans 'Please select or fill out for: ' %} {{ error }}</p></div>
        {% endfor %}
    {% endif %}
    </p>
{% endblock %}

{% block block_content %}
    <form action="{% url new_document %}" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        <p>
        <label for="id_title">{% trans 'Title' %}:</label><br />
        {{ form.title }}
        <label for="id_announce">{% trans 'Make announce' %}? </label>{{ form.announce }}
        </p>

        <p>
        <label for="id_description">{% trans 'Description' %}:</label><br />
        {{ form.description }}
        </p>

        <div class="block-container">
            <div class="left-combos">
                <div class="clear">
                <label for="id_item_type">{% trans 'Type' %}:</label><br />
                {{ form.item_type }}
                </div>

                <div class="clear">
                <label for="id_region">{% trans 'Region' %}:</label><br />
                {{ form.region }}
                </div>
            </div>

            <div class="right-combos">
                <div class="clear">
                <label for="id_topic">{% trans 'Topic' %}:</label><br />
                {{ form.topic }}
                </div>

                <div class="clear">
                <label for="id_program">{% trans 'Program' %}:</label><br />
                {{ form.program }}
                </div>
            </div>
        </div>
        <div class="clear">&nbsp;</div>
        <div class="clear">&nbsp;</div>
        <div class="clear">&nbsp;</div>
        <div class="block-container">
            <div class="left-combos">
                <div class="clear">
                <label for="id_created">{% trans 'Date created' %}:</label><br />
                {{ form.created }}
                </div>
            </div>
            <div class="right-combos">
                <div class="clear">
                    <label for="fileupload">{% trans 'File' %}:</label><br />
                    {{ upload_form.upload }}
                    <div class="clear"></div>
                    <span id="uploadmsg">{% trans 'Max size 5Gb' %}</span>
                </div>
            </div>
        </div>
        <p>
        <label for="id_tags">{% trans 'Tags' %}: </label><br />
        {{ form.tags }}
        </p>

        <hr />

        <p>
        <input type="submit" class="submit mid" value="{% trans 'Submit' %}" />
        </p>
    </form>
{% endblock %}

{% block scripts %}
    <script type="text/javascript" src="/static/js/chosen.jquery.min.js"></script>
    <script type="text/javascript" src="/static/js/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript" src="/static/js/lira.js"></script>
    <script type="text/javascript" src="/static/js/document-js.js"></script>
{% endblock %}
